
package com.jf.cloud.api.order.feign;

import com.jf.cloud.api.order.bo.EsPurchaseOrderBO;
import com.jf.cloud.common.feign.FeignInsideAuthConfig;
import com.jf.cloud.common.response.ServerResponseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author zz
 * @date 2020/11/23
 */
@FeignClient(value = "jfcloud-order",contextId = "purchase-order")
public interface PurchaseOrderFeignClient {

    /**
     * 获取采购订单需要保存到es中的数据
     * @param purchaseOrderId 采购订单id
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/purchase/saveMongoAndGetEsInfo")
    ServerResponseEntity<EsPurchaseOrderBO> saveMongoAndGetEsInfo(@RequestParam("purchaseOrderId")Long purchaseOrderId);

    /**
     * 更新采购订单的状态
     * @param purchaseOrderIds 采购订单id
     * @param purchaseOrderStatus 采购订单状态
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/purchase/updatePurchaseOrderStatus")
    ServerResponseEntity<Void> updatePurchaseOrderStatus(@RequestBody List<Long> purchaseOrderIds, @RequestParam("purchaseOrderStatus")Integer purchaseOrderStatus);
}
